package com.study.java.jinjie.jihe.ceshi;



import java.util.Random;

public class Preference {
    public static void main(String[] args) {
        // 创建一个长度为7的Person数组
        Love[] love = new Love[7];
        Random random = new Random();
        String[] name = {"丽丽", "古力", "热巴", "娜扎", "小三", "小陈", "笑笑"};
        for (int i = 0; i < love.length; i++) {
            int preference = random.nextInt(101); // 生成0到100的随机整数
            love[i] = new Love(name[i], preference);
            System.out.println(love[i].getName() + ": 喜爱度: " + love[i].getPreference()+ "% ! ");
        }
    }

}

//    public static void main(String[] args) {
//
//        System.out.print("姓名\t"+"喜爱度\n");
//        String love[] = {"a","b","c","d","e","f","h" };
//        Random random = new Random();
//        int l = love.length;
//        for (int i = 0; i < l; i++) {
//            int preference = random.nextInt(100)+1;
//            System.out.print(love[i]+"\t"+preference+"\n");
//        }
//   }